package tcln.sors.model.order.dom;

/**
 * @author Truong Chau Lien Ngoc (lienngoc@gmail.com)
 * 
 */
public enum OrderStatus {

    /**
     * an order is preparing (i.e. user is entering order details).
     */
    PREPARING(true),

    /**
     * an order is processing (check, control, deliver...).
     */
    PROCESSING(false),

    /**
     * an order has been expired (the deadline is over).
     */
    EXPIRED(false),

    /**
     * an order is closed successfully.
     */
    CLOSED(false),

    /**
     * an order is closed abnormally.
     */
    FAILED(false);

    private boolean savingAllowed;

    private OrderStatus(boolean savingAllowed) {
        this.savingAllowed = savingAllowed;
    }

    /**
     * Returns a flag indicating if this order status allows SAVE action on owner order.
     * 
     * @return the {@link #savingAllowed}.
     */
    public boolean isSavingAllowed() {
        return savingAllowed;
    }
}
